package com.jwaoo.mobile.view.forgotpassword.model;

import android.content.Context;
import com.dx.as.common.ILoadListener;
import com.jwaoo.mobile.http.HttpHelper;
import java.util.Map;
import http.IHttpListener;

/**
 * Created by jwaoo on 2017/10/18.
 */

public class PasswordModel extends IHttpListener{

    public PasswordModel(Context context, ILoadListener loadListener) {
        super(context, loadListener);
    }

    public int doSendEmail(Map map){
        return HttpHelper.doForgotPassword(map,this);
    }

    public int doUpdatePassword(Map map){
        return HttpHelper.doUpdatePassword(map,this);
    }

    @Override
    public void onResponse(Object response, int flg) {
        loadListener.onResponse(response,flg);
    }

    @Override
    public void onFailure(Throwable t) {
        loadListener.onFailure(t);
    }

    @Override
    public void onFilure(int code, String errorMsg) {
        loadListener.onFailure(code,errorMsg);
    }
}
